package com.nvwa.coding.function;

import com.nvwa.coding.util.safe.Coding;

import java.util.function.Consumer;


@FunctionalInterface
public interface ConsumerEX<T, EX extends Throwable> {

    void accept(T t) throws EX;

    default Consumer<T> toSilentConsumer() {
        return t -> Coding.silentExecute(() -> accept(t));
    }

    default Consumer<T> toLoggingConsumer() {
        return t -> Coding.loggingExecute(() -> accept(t));
    }
}
